package com.yanqu.road.server.cmd.cricket;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.cricket.CricketProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.cricketcourt.CrossCricketCourtMgr;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_CRICKET_BATTLE_LOG_UPLOAD, desc = "蛐蛐战报上传")
public class CrossCricketBattleLogUploadCmd extends CrossCommand {
    private CricketProto.CricketBattleLogAddReqMsg reqMsg;

    private long userId;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        reqMsg = CricketProto.CricketBattleLogAddReqMsg.parseFrom(packet.getBytes());
        userId = packet.getPlayerId();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CrossCricketCourtMgr.battleLogAdd(serverId, userId, reqMsg);
    }

    @Override
    public void sendData() {

    }
}
